<template>
	<view v-if="newsNumber > 0" class="news_info" @tap.stop="handleJumpDiy" data-type="navigateTo" :data-url="`/pages/home/myNews/myNews`">
		<image :src='STATIC_URL+"22.png"' mode="aspectFill"></image>
		<text>{{newsNumber}}</text>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				newsNumber: 0
			}
		},
		created() {
			if (global.token) {
				this.getNewsNumber();
			}
		},
		methods: {
			// 获取消息数量 643915f22d9ed
			getNewsNumber() {
				this.$api.post(global.API_VERSION + '/643915f22d9ed', {
			
				}).then(res => {
					if (res.data.code == 1) {
						this.newsNumber = res.data.data.unread_nums;
					} else {
						this.$message.info(res.data.msg);
					}
				})
			},
		}
	}
</script>

<style lang="scss" scoped>
	.news_info {
		min-width: 200rpx;
		// height: 88rpx;
		padding: 18rpx 24rpx;
		background: #8B060D;
		border-radius: 44rpx;
		position: fixed;
		bottom: 110rpx;
		right: 32rpx;
		z-index: 5;
		display: flex;
		align-items: center;
		justify-content: center;
		color: #fff;
		font-weight: 500;
		font-size: 36rpx;
		image {
			width: 54rpx;
			height: 54rpx;
			margin-right: 16rpx;
		}
	}
</style>